package c.j.a.c.h;

import android.content.DialogInterface;
import android.text.TextUtils;
import c.j.a.a.a.e.c.c;
import c.j.a.b.a.c.a;
import c.j.a.c.g$g.e;
import c.j.a.c.g.y;
import c.j.a.c.q.d;
import com.ss.android.downloadlib.activity.TTDelegateActivity;
import java.util.Objects;

/* compiled from: TTDelegateActivity */
public class b implements c {
    public final /* synthetic */ a a;
    public final /* synthetic */ TTDelegateActivity b;

    public b(TTDelegateActivity tTDelegateActivity, a aVar) {
        this.b = tTDelegateActivity;
        this.a = aVar;
    }

    public void a(DialogInterface dialogInterface) {
        d.i(this.b);
    }

    public void b(DialogInterface dialogInterface) {
        c.j.a.c.o.b.b.a.i("market_openapp_cancel", this.a);
        dialogInterface.dismiss();
        d.i(this.b);
    }

    public void c(DialogInterface dialogInterface) {
        a aVar = this.a;
        c.j.a.c.o.b bVar = c.j.a.c.o.b.b.a;
        if (aVar != null) {
            String str = null;
            if (c.j.a.d.b.l.a.f.b("app_link_opt", 0) == 1) {
                str = aVar.g;
            }
            e m = y.m(str);
            if (m.a == 2) {
                if (!TextUtils.isEmpty(str)) {
                    bVar.n("deeplink_url_open_fail", y.d(str), aVar);
                }
                m = y.l(y.a(), aVar.e);
            }
            int i = m.a;
            if (i == 1 || i == 3) {
                bVar.i("market_openapp_success", aVar);
                c.j.a.a.a.a.b p = y.p();
                y.a();
                aVar.a();
                aVar.c();
                aVar.b();
                Objects.requireNonNull((y.a) p);
            } else {
                if (i == 4) {
                    bVar.i("deeplink_app_open_fail", aVar);
                }
                d.n();
                y.q().a(4, y.a(), aVar.a(), "应用打开失败，请检查是否安装", null, 1);
                bVar.i("market_openapp_failed", aVar);
            }
        }
        dialogInterface.dismiss();
        d.i(this.b);
    }
}
